<template>
	<file-preview :src="src" :file-type="fileType" @goBack="emit('goBack')" />
</template>

<script setup name="filePreviewDialog">
	import sysConfig from '@/config/index'

	const src = ref()
	const fileType = ref()

	const emit = defineEmits(['goBack'])
	const onOpen = (record) => {
		src.value = sysConfig.API_URL + record.uri
		fileType.value = record.suffix
	}

	defineExpose({
		onOpen
	})
</script>
